package org.example.controller;

import lombok.extern.slf4j.Slf4j;
import org.example.util.JsonResult;
import org.example.util.ResultTool;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther:Liu
 * @Testname:sixthcontroller
 * @Date:2025/7/30 17:05
 */
@Slf4j
@RestController
@RequestMapping("/sixth")
public class sixthcontroller {

    @GetMapping("/a")
    public JsonResult a(){
        return ResultTool.success("a");
    }

    @GetMapping("/b/{name}")
    public JsonResult b(@PathVariable("name") String name){
        return ResultTool.success(name);
    }

    @GetMapping("/c/{name}/{age}")
    public JsonResult c(@PathVariable("name") String name, @PathVariable("age") int age){
        return ResultTool.success(name+":"+age);
    }
}
